<?php require_once('../../core/import.php');?>
<?php User::Permission('PROCUREMENT_LIST'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <script type="text/javascript" src="../../scripts/import.js"></script>
    <script type="text/javascript" src="../../scripts/components/checkbox/import.checkbox.js"></script>
    <script type="text/javascript" src="../../scripts/components/zebra_table/import.zebra_table.js"></script>
    <script type="text/javascript" src="scripts/list.js"></script>
</head>

<body>
<form id="Form_select" name="Form_select" method="post" action="list.php">
    <table width="98.5%" border="0" cellpadding="0" cellspacing="0" class="List">
    <thead>
    <tr>
        <th width="8%" height="25" align="right" valign="middle">产品名称：&nbsp; </th>
        <th width="20%" height="25" align="left" valign="middle"><input type="text" name="Keyword" /></th>
        <th width="20%" height="25" align="left" valign="middle">
        		<select name="FirstClass" size="1" id="FirstClass" >
	  			 <option value="">--请选择一级类别--</option> 
                  </select>
        </th>
        <th width="20%" height="25" align="left" valign="middle">
        		<select name="SecondClass" size="1" id="SecondClass">
                    	 <option value="">--请选择二级类别--</option>
                  </select>
        </th>
        <th width="32%" height="25" align="left" valign="middle"><input type="submit" value="搜 索" /></th>
    </tr>
    </thead>
    </table>
    </form>
    <table width="98.5%" id="List" border="0" cellpadding="0" cellspacing="0" class="List">
    <thead>
    <tr>
        <th width="5%" height="25" align="center" valign="middle">选取</th>
        <th width="15%" align="left" valign="middle">&nbsp;会员</th>
        <th width="15%" align="center" valign="middle">产品名称</th>
        <th width="10%" align="center" valign="middle">规格</th>
        <th width="10%" align="center" valign="middle">数量</th>
        <th width="10%" align="center" valign="middle">有效期</th>
        <th width="15%" align="center" valign="middle">发布日期</th>
        <th width="9%" align="center" valign="middle">操作</th>
    </tr>
    </thead>    
    <tbody>
    <form id="Form1" name="Form1" method="post" >
    <?php
        #获取数据
	  $Keyword=Functions::HttpArgs('Keyword');
	  $Wheres=' where 1=1 ';
	  if($Keyword)
	      {
		  $Wheres=$Wheres." and Title like '%$Keyword%' ";
	 	}
	  $Orders=$Wheres.' order by ID desc';	  
        $Data=DB::GetData('select ID,Account,Title,Norms,Amount,Datetime,Validity from procurement '.$Orders.' limit ?,15');
        foreach($Data['Record'] as $Row)
        {
    ?>
    <tr>
        <td height="25" align="center" valign="middle">
            <input id="ID" name="ID[]" type="checkbox" value="<?php echo $Row['ID']; ?>" class="Cursor_Pointer" />
        </td>
        <td height="25" valign="middle">
            &nbsp;<a href="edit.php?id=<?php echo $Row['ID']; ?>"><?php echo $Row['Account']; ?></a>
        </td>
        <td height="25" align="center" valign="middle">
            <?php echo Functions::SubStr($Row['Title'],30); ?>
        </td>
        <td height="25" align="center" valign="middle">
            <?php echo Functions::SubStr($Row['Norms'],20); ?>
        </td>
        <td height="25" align="center" valign="middle">
            <?php echo $Row['Amount']; ?>
        </td>
        <td height="25" align="center" valign="middle">
            <?php echo date('Y-m-d',strtotime($Row['Validity']));?>
        </td>
        <td height="25" align="center" valign="middle">
            <?php echo $Row['Datetime'];?>
        </td>
        <td height="25" align="center" valign="middle">
            <a href="edit.php?id=<?php echo $Row['ID']; ?>">编辑</a>
            <a href="javascript:mconfirm_delete('list.action.delete.php?id=<?php echo $Row['ID']?>');">删除</a>
        </td>
    </tr>
    <?php
        }
    ?>
    </form>
    </tbody>    
    <tfoot>
    <tr>
        <td height="25" colspan="8" align="center" valign="middle">
            <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td width="55%" align="left">
                <?php
                    PagerFactory::Create('Simple')->Display($Data);
                ?>
                </td>
                <td width="45%" align="right">
                    <span id="SelectAll" class="Cursor_Pointer">全选</span>/<span id="UnSelectAll" class="Cursor_Pointer">全不选</span>
                    选中项：<span id="Delete" class="Cursor_Pointer">删除</span>&nbsp;/&nbsp;<span id="IsTop" class="Cursor_Pointer">推荐</span>             
                </td>
            </tr>
            </table>    
         </td>
	</tr>
    </tfoot>    
    </table>
</body>
</html>